This invention relates to improvements in a pattern discriminator, and more particularly to improvements in either a multi-window type pattern discriminator, or an expanded version of a type of discriminator referred to as a template matching pattern discriminator previously proposed by one of the present inventors (see Japanese Patent Application No. 016433, 1982).
In a multi-window type pattern discriminator previously proposed, the characteristics of sectional patterns in a plurality of window regions are set up within a field of vision of a television camera. The characteristics are then quantitatively extracted from binary coded outputs obtained by processing the time based electrical signals using preset threshold levels. The time based electrical signals are obtained by picking up images of patterns being examined with a photoelectric converter of the two-dimension sequential scanning type (for example, an industrial television camera). Subsequently, a range of upper and lower threshold limits is set up on a window region basis, and the magnitude of a characteristic extracted from the scan bears logic 1 if the magnitude is within the range, and logic 0 if not within the range. (This step will be referred to as the first decision step.) Some window regions are then combined into a group and the combined results of the first decision step regarding each window region in a group is compared with a preset table of first decision data (the combined results of the first decision step for each region constituting each group where good patterns exist, having been entered into a table beforehand) in order to distinguish bad patterns from good patterns (this step will be referred to as the second decision step). This second decision step is carried out for all the groups and then it is comprehensively determined whether a pattern is good or bad based on the above results.
For any groups which have been found bad, a correlative decision step is made in the next stage, if necessary. The correlative decision step will be described as follows.
When an examined pattern, even if it is a good one, is slipped out of the preset position within the camera's field of vision, the magnitude of the characteristic extracted from the predetermined window region may not fall within the range of preset threshold levels. Consequently, the first decision step would result in a bad pattern being detected. However, because the pattern has been moved slightly sideward, if the correlation between the magnitude of the characteristic detected through the predetermined window region and an adjacent window region is obtained, (in this case, the correlation is represented by additions, subtractions and the like) the correlated magnitude obtained is contained within the range of preset threshold levels and the result of the first decision should instead be found good. In view of this, a combination of related proper window regions is chosen, the magnitude of each characteristic is operationally processed (for instance, added) between the regions, and the first decision is made on the processed results (this is called a first correlative decision). A collection of the results of the first correlative decision is compared with a preset table of the first correlative decisions (which should be obtained beforehand in the same manner as the first decision table) to make a second correlative decision, whereupon it is determined whether the pattern is good or bad.
To extract the magnitude of a characteristic, it is generally needed to convert an image signal obtained by an apparatus such as a TV camera into a binary coded value, and the magnitude of the characteristic is extracted from the binary coded data.
In the above-mentioned multi-window type apparatus, although it is supplied with a number of windows (for example, 32-64 windows), using only one binary conversion circuit system with a fixed threshold level for converting all image pickup signals into corresponding binary values may not result in obtaining accurate binary data, because the level of an image pickup signal from the TV camera varies with the portion of the object if either a shade of color in the examined pattern changes depending on the portion of the object, or the density of the examined pattern varies with the portion of the object. In such a case, making a decision on the pattern being examined using improper binary data may result in erroneous decisions of the patterns being examined.
The present invention is also directed to a novel means for storing data representing window regions. In this context, a conventional arrangement for storing window region data will first be discussed.
FIG. 1 illustrates window regions M1, M2 on a picture plane P represented by rectangular coordinates X, Y on a two-dimensional basis. When the whole picture plane is raster scanned by scanning the plane P horizontally in the X direction and vertically in the Y direction, the window region generator generates outputs by scanning only in the window regions M1, M2.
FIG. 2 is a diagram illustrating the relationship between the coordinates of a window region. In other words, if the window region of M1 is divided by ordinates along horizontal scanning lines in the X direction and the coordinates of the first and last abscissa (X) points of the window region are stored, this window region may be represented in storage.
In FIG. 2, for instance, X.sub.RY1,1 and X.sub.FY1,1 represent the first and last points of the window region M1 on the scanning line in the X direction along the ordinate Y1. In the subscript RY1,1, the letter R signifies a leading point (starting point), Y1 signifies the abscissa location of this leading point, and 1 signifies that this leading point is the first leading point on the horizontal scanning line involved. In the subscript FY1,1, the letter F signifies a trailing point (end point), Y1 signifies the abscissa location of this trailing point, and 1 signifies that this trailing point is the first trailing point along this horizontal scanning line.
Thus the first point of the window region M1 on the horizontal scanning line along the ordinate a is represented by X.sub.Ra1, while the last point of the window region is represented by X.sub.Fa1. On the horizontal scanning line along the ordinate b, second leading and second trailing points X.sub.Rb2, X.sub.Fb2 occur after first leading and trailing points X.sub.Rb1, X.sub.Fb1.
When the ordinate is a and the abscissa is X.sub.Ra1, the window output signal value then becomes "1" to open a window and remains at "1" until the abscissa reaches X.sub.Fa1 whereupon the window is closed. As mentioned above, for the ordinate b, the first leading point of the window is located at X.sub.Rb1 and the first trailing point at X.sub.Fb1. When the ordinate is b, the window M2 is opened at the second leading point X.sub.Rb2 and closed at the second trailing point X.sub.Fb2.
FIG. 3 is a diagram illustrating the arrangement of a window region storage memory adopted in a conventional window output generator, and shows an arrangement of data in a memory for the window region shown in FIG. 2. In the arrangement shown in FIG. 3, the leftmost column indicates the abscissa which starts with 1 and ends with 256 (assuming that 256 horizontal scanning lines constitute one picture plane). On the basis of assigning one ordinate value for each scanning line, each abscissa of the first leading and trailing points and the second leading and trailing points is obtained and stored as shown in FIG. 3. When a leading or trailing point does not exist, either a mark * is stored to indicate their non-existence or the column is left blank.
Assuming that a one byte (8 bit) capacity is required to store the abscissa of one leading or trailing point, 256 bytes would be needed to store all the abscissa of the first points for each scanning line, and an additional 256 bytes to store all the abscissas of the last points for each scanning line, so that a total of at least 512 bytes would be required even for only one window per scanning line. Moreover, if second leading and trailing points exist (i.e. more than one window along a scanning line), the storage capacity will need to be twice as much. If the unused addresses (marked with *) are compressed and eliminated, one may not have the flexibility to be able to change the location or number of window regions to be generated. Therefore, according to this prior art scheme unused addresses may be required if alteration of the number and/or location of the window region is contemplated. If one attempts to generate a window region in which a maximum of m leading (or trailing) points exist on the same abscissa a storage capacity of (512.times.m) bytes will be required, m being normally about 8 and about 16 at maximum.
As mentioned above, because the storage capacity of the memories used in a conventional window output generator is determined by the maximum number of the first (or last) points in a window region located on the same ordinate, the requisite storage capacity becomes enormous and the number of peripheral read and write circuits also increases commensurately, resulting in high production costs. Another disadvantage is that the use efficiency of memories is low because many addresses will not be used. Still another disadvantage lies in the fact that as the number of window regions on the same ordinate increases, the above generator lacks versatility from the standpoint of the hardware arrangement, because the storage capacity must be increased by 512 bytes whenever the number of window regions increases even by one.